

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>1. VideoTester.config — Common constants and functions &mdash; VideoTester 0.2 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/VTfavicon.png"/>
    <link rel="top" title="VideoTester 0.2 documentation" href="index.html" />
    <link rel="up" title="Module Reference" href="modules.html" />
    <link rel="next" title="2. VideoTester.core — Client and server base classes" href="core.html" />
    <link rel="prev" title="Module Reference" href="modules.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="core.html" title="2. VideoTester.core — Client and server base classes"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="modules.html" title="Module Reference"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">VideoTester 0.2 documentation</a> &raquo;</li>
          <li><a href="modules.html" accesskey="U">Module Reference</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-VideoTester.config">
<span id="videotester-config-common-constants-and-functions"></span><h1>1. <tt class="docutils literal"><span class="pre">VideoTester.config</span></tt> &#8212; Common constants and functions<a class="headerlink" href="#module-VideoTester.config" title="Permalink to this headline">¶</a></h1>
<div class="section" id="constants">
<h2>1.1. Constants<a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h2>
<dl class="data">
<dt id="VideoTester.config.VTLOG">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">VTLOG</tt><a class="headerlink" href="#VideoTester.config.VTLOG" title="Permalink to this definition">¶</a></dt>
<dd><p>VT logger.</p>
</dd></dl>

<dl class="data">
<dt id="VideoTester.config.USERPATH">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">USERPATH</tt><a class="headerlink" href="#VideoTester.config.USERPATH" title="Permalink to this definition">¶</a></dt>
<dd><p>Current working path (result of <a class="reference external" href="http://docs.python.org/library/os.html#os.getcwd" title="(in Python v2.7)"><tt class="xref py py-func docutils literal"><span class="pre">os.getcwd()</span></tt></a> function).</p>
</dd></dl>

<dl class="data">
<dt id="VideoTester.config.CONF">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">CONF</tt><a class="headerlink" href="#VideoTester.config.CONF" title="Permalink to this definition">¶</a></dt>
<dd><p>Path to the default configuration file (relative to <a class="reference internal" href="#VideoTester.config.USERPATH" title="VideoTester.config.USERPATH"><tt class="xref py py-const docutils literal"><span class="pre">USERPATH</span></tt></a>).</p>
</dd></dl>

<dl class="data">
<dt id="VideoTester.config.TEMP">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">TEMP</tt><a class="headerlink" href="#VideoTester.config.TEMP" title="Permalink to this definition">¶</a></dt>
<dd><p>Path to the temporary directory (relative to <a class="reference internal" href="#VideoTester.config.USERPATH" title="VideoTester.config.USERPATH"><tt class="xref py py-const docutils literal"><span class="pre">USERPATH</span></tt></a>).</p>
</dd></dl>

<dl class="data">
<dt id="VideoTester.config.SERVERIFACE">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">SERVERIFACE</tt><a class="headerlink" href="#VideoTester.config.SERVERIFACE" title="Permalink to this definition">¶</a></dt>
<dd><p>Server interface.</p>
</dd></dl>

<dl class="data">
<dt id="VideoTester.config.SERVERIP">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">SERVERIP</tt><a class="headerlink" href="#VideoTester.config.SERVERIP" title="Permalink to this definition">¶</a></dt>
<dd><p>Server IP address.</p>
</dd></dl>

<dl class="data">
<dt id="VideoTester.config.SERVERPORT">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">SERVERPORT</tt><a class="headerlink" href="#VideoTester.config.SERVERPORT" title="Permalink to this definition">¶</a></dt>
<dd><p>Server base port.</p>
</dd></dl>

<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference internal" href="#VideoTester.config.CONF" title="VideoTester.config.CONF"><tt class="xref py py-const docutils literal"><span class="pre">CONF</span></tt></a>, <a class="reference internal" href="#VideoTester.config.TEMP" title="VideoTester.config.TEMP"><tt class="xref py py-const docutils literal"><span class="pre">TEMP</span></tt></a> and <a class="reference internal" href="#VideoTester.config.SERVERPORT" title="VideoTester.config.SERVERPORT"><tt class="xref py py-const docutils literal"><span class="pre">SERVERPORT</span></tt></a> MAY be replaced by more suitable values.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last"><a class="reference internal" href="#VideoTester.config.SERVERIFACE" title="VideoTester.config.SERVERIFACE"><tt class="xref py py-const docutils literal"><span class="pre">SERVERIFACE</span></tt></a> MUST be replaced according to your network configuration, and <a class="reference internal" href="#VideoTester.config.SERVERIP" title="VideoTester.config.SERVERIP"><tt class="xref py py-const docutils literal"><span class="pre">SERVERIP</span></tt></a> will be set automatically.</p>
</div>
</div>
<div class="section" id="functions">
<h2>1.2. Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="VideoTester.config.makeDir">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">makeDir</tt><big>(</big><em>dir</em><big>)</big><a class="headerlink" href="#VideoTester.config.makeDir" title="Permalink to this definition">¶</a></dt>
<dd><p>Make the directory <cite>dir</cite> if not exists.</p>
</dd></dl>

<dl class="function">
<dt id="VideoTester.config.initLogger">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">initLogger</tt><big>(</big><em>args</em><big>)</big><a class="headerlink" href="#VideoTester.config.initLogger" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize the VT logger: this function sets a formatter, the handlers and their logging levels.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>args</strong> &#8211; The command-line arguments returned by <a class="reference internal" href="#VideoTester.config.parseArgs" title="VideoTester.config.parseArgs"><tt class="xref py py-func docutils literal"><span class="pre">parseArgs()</span></tt></a>.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="VideoTester.config.parseArgs">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">parseArgs</tt><big>(</big><big>)</big><a class="headerlink" href="#VideoTester.config.parseArgs" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the command-line arguments with the standard module <a class="reference external" href="http://docs.python.org/library/argparse.html#argparse" title="(in Python v2.7)"><tt class="xref py py-mod docutils literal"><span class="pre">argparse</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">An object with the argument strings as attributes.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="VideoTester.config.getIpAddress">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">getIpAddress</tt><big>(</big><em>ifname</em><big>)</big><a class="headerlink" href="#VideoTester.config.getIpAddress" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the IP address of a network interface.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ifname</strong> (<a class="reference external" href="http://docs.python.org/library/string.html#string" title="(in Python v2.7)"><em>string</em></a>) &#8211; The interface name.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The IP address.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="VideoTester.config.bubbleSort">
<tt class="descclassname">VideoTester.config.</tt><tt class="descname">bubbleSort</tt><big>(</big><em>l</em>, <em>l1=None</em>, <em>l2=None</em><big>)</big><a class="headerlink" href="#VideoTester.config.bubbleSort" title="Permalink to this definition">¶</a></dt>
<dd><p>Bubble sort algorithm modification. This function sorts the first list. Optionally, it sorts two additional lists with the same pattern than the first.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>l</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; One list.</li>
<li><strong>l1</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; Other list.</li>
<li><strong>l2</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; Other list.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/VT200x170.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">1. <tt class="docutils literal"><span class="pre">VideoTester.config</span></tt> &#8212; Common constants and functions</a><ul>
<li><a class="reference internal" href="#constants">1.1. Constants</a></li>
<li><a class="reference internal" href="#functions">1.2. Functions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="modules.html"
                        title="previous chapter">Module Reference</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="core.html"
                        title="next chapter">2. <tt class="docutils literal"><span class="pre">VideoTester.core</span></tt> &#8212; Client and server base classes</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/config.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="core.html" title="2. VideoTester.core — Client and server base classes"
             >next</a> |</li>
        <li class="right" >
          <a href="modules.html" title="Module Reference"
             >previous</a> |</li>
        <li><a href="index.html">VideoTester 0.2 documentation</a> &raquo;</li>
          <li><a href="modules.html" >Module Reference</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2013, Iñaki Úcar.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>